/**
 * 代理商
 */
import makeApi from './index';
import { request, config } from '../configs';
// const { api: apiPath } = config;

export const api = {
	create: '/agent/add',
	remove: '/agent/delete',
	update: '/agent/update',
	detail: '/agent/detail',
	// bindingAccountList: '/agent/bindingAccount',
	switchStatus: '/agent/switch',
	querybase: '/agent/list',
	subList: '/operator/listByOperator',
	getSonOperators: '/benefit/shareBenefitRule/sonOperators',
	agentChild: '/agent/children',
	bindAccount: '/agent/bind',
};

export const defaultData = {// 请求数据
	current: 1,
	size: 10,
	total: 0
};

function bindingAccountList(data) {
	return request({
		data,
		url: config.api.bindingAccountList,
		method: 'get',
	});
}

const services = makeApi(api);


const {
	create,
	remove,
	update,
	detail,
	// bindingAccountList,
	switchStatus,
	querybase,
	subList,
	getSonOperators,
	agentChild,
	bindAccount,
} = services;

export {
	create,
	remove,
	update,
	detail,
	bindingAccountList,
	switchStatus,
	querybase,
	subList,
	getSonOperators,
	agentChild,
	bindAccount,
};

export default services;

